package com.hgkj.cloud.base.service.impl;

import com.hgkj.cloud.base.common.PageInfo;
import com.hgkj.cloud.base.dao.SysLogsMapper;
import com.hgkj.cloud.base.domain.SysLogs;
import com.hgkj.cloud.base.service.SysLogsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class SysLogsServiceImpl implements SysLogsService {

    @Autowired
    private SysLogsMapper sysLogsMapper;

    @Override
    public int deleteByPrimaryKey(Long id) {
        return sysLogsMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(SysLogs record) {
        return sysLogsMapper.insert(record);
    }

    @Override
    public int insertSelective(SysLogs record) {
        return sysLogsMapper.insertSelective(record);
    }

    @Override
    public SysLogs selectByPrimaryKey(Long id) {
        return sysLogsMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(SysLogs record) {
        return sysLogsMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(SysLogs record) {
        return sysLogsMapper.updateByPrimaryKey(record);
    }

    @Override
    public Long findAllLogCount(Map<String, Object> map) {
        return sysLogsMapper.findAllLogCount(map);
    }

    @Override
    public List<SysLogs> listLogs(PageInfo pi, Map<String, Object> map) {
        if(pi != null){
            map.put("currentCount", pi.getCurrentCount());
            map.put("pageSize", pi.getPageSize());
        }
        return sysLogsMapper.listLogs(map);
    }
}
